<div class="page downloads">
<h2 class="title01"><span><img src="<?php echo $this->getSkinUrl()?>images/image_01.gif" alt="" width="19" height="19" /></span>Downloads</h2>
<p class="articles">
<?php echo Mage::getModel('cms/block')->load(7)->getContent()?>
</p>
<div class="subnav">
<ul>
<?php 
$catcollection = Mage::getModel('downloadcenter/cat')->getCollection();

$i=0;
foreach ($catcollection as $_cat) {
	echo '<li><a href="javascript:clickShowIcon(\''.$_cat->getId().'\');" id="toplink'.$_cat->getId().'">'.strtoupper($_cat->getTitle()).'</a>';
	$i++;
	if($i<count($catcollection)){
		echo '|';
	}
	echo '</li>';
}
?>
</ul>
</div>
<div class="container" style="padding-top:10px;">
<div class="fillet_top"></div>
<div class="cont">
<div class="show_cont">
<?php 
$i=0;
foreach ($catcollection as $_cat) {
	?>
	<dl>
		<dt>
		<a href="javascript:clickShowIcon('<?php echo $_cat->getId()?>');">
		<img src="<?php echo $this->getSkinUrl()?>images/download_<?php echo $_cat->getId()?>.jpg" alt="<?php echo $_cat->getTitle()?>"/>
		</a>
		</dt>
		<dd><a href="javascript:clickShowIcon('<?php echo $_cat->getId()?>');">Download <?php echo $_cat->getTitle()?>?</a></dd>
	</dl>
	<?php 
}
?>
<div class="hack"></div>
</div>
</div>
<div class="fillet_bottom"></div>
</div>
<?php 
$i=0;
foreach ($catcollection as $_cat) {
	$postcollection = Mage::getModel('downloadcenter/downloadcenter')->getCollection()
			->addStoreFilter(Mage::app()->getStore()->getId())
			->addCatFilter($_cat->getId())
			->setOrder('created_time', 'desc');
	Mage::getSingleton('downloadcenter/status')->addEnabledFilterToCollection($postcollection);
	?>
	<div class="container">
	<div class="fillet_top"></div>
	<div class="cont">
	<h3>
	<strong class="tt"><?php echo $_cat->getTitle()?> Downloads</strong>
	<span class="click" id="downloadsexpand<?php echo $_cat->getId()?>">
	<a href="javascript:clickShowIcon('<?php echo $_cat->getId()?>');">
	Click to view options
	<img width="28" height="28" alt="<?php echo $_cat->getTitle()?>" src="<?php echo $this->GetSkinUrl()?>images/image_02.gif"/>
	</a>
	</span>
	</h3>
	<div class="list_cont" id="downloadsdetail<?php echo $_cat->getId()?>" style="display:none">
	<div>
	<?php foreach ($postcollection as $_post) {
		?>
		<dl>
		<dt>
		<a href="<?php echo Mage::getBaseUrl('media').$_post->getNfile()?>" target="_blank">
		<?php 
		if($_post->getNfile2()){
		?>
		<img src="<?php echo Mage::getModel('imageresize/imagemodel')->init(Mage::getBaseUrl('media').$_post->getNfile2())->resize(109,109)?>" alt="<?php echo $_post->getNfile2Alt()?>" />
		<?php }?>
		</a>
		</dt>
		<dd>
		<p><?php echo $_post->getTitle()?></p>
		<p><a href="<?php echo Mage::getBaseUrl('media').$_post->getNfile()?>" target="_blank">Click here ></a></p>
		</dd>
		</dl>
		<?php 
	}
	?>
	</div>
	<div class="hack"></div>
	</div>
	<span class="click" id="downloadsclosebar<?php echo $_cat->getId()?>" style="display:none">
	<a href="javascript:clickShowIcon('<?php echo $_cat->getId()?>');">
	Click to close options<img src="<?php echo $this->getSkinUrl()?>images/image_03.gif" alt="" width="28" height="28" />
	</a>
	</span>
	</div>
	<div class="fillet_bottom"></div>
	</div>
	<?php 
}
?>

</div>

<script type="text/javascript">

<!--

function clickShowIcon(id){

	new Effect.toggle('downloadsdetail'+id,'slide',{duration:0.7});
	new Effect.toggle('downloadsexpand'+id,'slide',{duration:0.7});
	new Effect.toggle('downloadsclosebar'+id,'slide',{duration:0.7});

	//new Element.toggle('downloadsdetail'+id);
	//new Element.toggle('downloadsexpand'+id);
	//new Element.toggle('downloadsclosebar'+id);

	if(document.getElementById('toplink'+id).className==''){

		document.getElementById('toplink'+id).className='current';

		var i=2;

		while(i<=4){

			if(i!=id){

				if(document.getElementById('downloadsexpand'+i).style.display=='none'){

					document.getElementById('toplink'+i).className='';

					new Effect.toggle ('downloadsdetail'+i,'slide',{duration:0.3});
					new Effect.toggle ('downloadsexpand'+i,'slide',{duration:0.3});
					new Effect.toggle ('downloadsclosebar'+i,'slide',{duration:0.3});

					//new Element.toggle('downloadsdetail'+i);
					//new Element.toggle('downloadsexpand'+i);
					//new Element.toggle('downloadsclosebar'+i);

				}

			}

			i++;

		}

		

	}else{

		document.getElementById('toplink'+id).className='';

	}

}



function winpop(memid) { 

  //window.open("view_images.php?model=&gid="+memid,"_blank","menubar=1,resizable=1,scrollbars=1,width=750,height=800"); 

} 



function capturepop(brochure) { 

  //window.open("/customer/main/capture_pdf.php?id="+brochure,"_blank","width=300,height=350,scrollbars=1"); 

} 



-->

</SCRIPT>
